//
//  FontViewController.m
//  Days
//
//  Created by lanou3g on 16/1/9.
//  Copyright © 2016年 dss. All rights reserved.
//

#import "FontViewController.h"
#import "HuoHandel.h"
#import "DataHandel.h"

@interface FontViewController ()
@property (strong, nonatomic) IBOutlet UITextView *fristTextView;
@property (strong, nonatomic) IBOutlet UITextView *secondTextView;
@property (strong, nonatomic) IBOutlet UITextView *thirdTextView;

@end

@implementation FontViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    
    // Do any additional setup after loading the view from its nib.
}

#pragma mark -- 点击转换

- (IBAction)conversionBtnDidClicked:(id)sender {
    
    [self.thirdTextView endEditing:YES];
    
   NSString *urlFang =  [[HuoHandel sharedHandel]getUrlStrWithtext:self.fristTextView.text andType:1];
    NSString *urlHuo = [[HuoHandel sharedHandel]getUrlStrWithtext:self.fristTextView.text andType:2];
    
    [[DataHandel sharedHandel]getDataWithURL:urlFang withBlock:^(id object) {
    
        self.secondTextView.text = [object valueForKey:@"outstr"];
        
        
    }];
    
    [[DataHandel sharedHandel]getDataWithURL:urlHuo withBlock:^(id object) {
        self.thirdTextView.text = [object valueForKey:@"outstr"];
        
    }];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
